Skip to content

React Doctor pass: a11y labels, Fast Refresh boundaries, stable keys, SVG precision (100/100)#4

Merged
Sam Gammon (sgammon) merged 5 commits into
mainfrom
fix/react-doctor-cleanup
Jul 15, 2026
Merged

React Doctor pass: a11y labels, Fast Refresh boundaries, stable keys, SVG precision (100/100)#4
Sam Gammon (sgammon) merged 5 commits into
mainfrom
fix/react-doctor-cleanup

Conversation

@sgammon

Copy link
Copy Markdown
Member

Summary

Full React Doctor triage of @elide/ui — fixes all 14 findings across 4 rules, taking the health score to 100/100 (No issues found!). Also lands the React Doctor CI workflow, a root bun run doctor script, and the local agent triage skill. The public API of @elide/ui is unchanged — the barrel re-exports everything from its new locations.

Each fix follows the canonical recipe fetched from react.doctor for its rule, and every commit builds green on its own:

  • fix(a11y) — the changelog/install anchors passed to Button render={...} are empty in source (their text merges in at runtime), so assistive tooling sees unlabeled links. Each now carries an aria-label bound to the same i18n message as its visible text, so the accessible name can't drift from what's on screen. (×3 sites)
  • refactor(ui) — files exporting both a component and something else (cva variants, hooks) break Vite Fast Refresh, wiping component state on every edit. The four cva style objects moved to sibling *-variants.ts files; useTheme/useMessages moved next to their contexts (theme-context.ts, i18n/context.ts). (×6 files)
  • fix(ui) — array-index keys reattach state/DOM to the wrong rows if a list reorders or filters. Breadcrumbs key by href ?? label, stats by label; code lines and support-matrix rows (where content can legitimately repeat) key via a new keyed() helper: content + occurrence counter. (×4 lists)
  • perf(ui) — the Elide mark shipped Illustrator-export 6-decimal coordinates in a ~103-unit viewBox drawn 23px tall; all 352 numbers rounded to 2 decimals (~halves the inline path data) with separator-safe handling so no coordinates merge.

Test plan

  • npx react-doctor@latest --verboseNo issues found, 100/100 (was 14 issues)
  • tsc --noEmit clean
  • vitest — 74/74 tests pass
  • eslint src clean
  • tsup package build succeeds
  • Eyeball ElideMark in Storybook/Chromatic to confirm the rounded paths render pixel-identical

🤖 Generated with Claude Code

Sam Gammon (sgammon) and others added 5 commits July 14, 2026 18:17
Advisory PR scans + main-branch trend tracking via millionco/react-doctor@v2,
a root `bun run doctor` script, and the local triage skill for agents.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The changelog/install anchors passed to `Button render={...}` only receive
their visible text at runtime, so statically they are empty links that
screen-reader tooling flags as announcing nothing. Give each an aria-label
bound to the same i18n message as the visible text so the two cannot drift.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Index keys reattach React state and DOM to the wrong rows if a list ever
reorders or filters. Breadcrumb segments now key by href/label and stats by
label; code lines and support-matrix rows, whose content can legitimately
repeat, key via a new `keyed()` helper (content + occurrence counter) so keys
follow the item and duplicates never collide.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The mark was an Illustrator export with 6-decimal coordinates in a ~103-unit
viewBox rendered 23px tall — sub-pixel precision nobody can see. Rounding all
352 numbers roughly halves the inline path data. Dot-form numbers that ride on
the previous coordinate's implicit separator keep their dot or gain an explicit
comma, so no coordinates merge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A file that exports both a component and anything else (cva style objects,
hooks) breaks Vite Fast Refresh — every edit full-reloads and wipes component
state. Move the four cva variants to sibling *-variants.ts files and the
useTheme/useMessages hooks next to their contexts (theme-context.ts,
i18n/context.ts), repointing importers. The @elide/ui barrel re-exports
everything from the new locations, so the public API is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit da13f1b.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.61%. Comparing base (29161cc) to head (da13f1b).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main       #4      +/-   ##
==========================================
- Coverage   84.85%   83.61%   -1.25%     
==========================================
  Files          32       38       +6     
  Lines         601      659      +58     
  Branches      230      254      +24     
==========================================
+ Hits          510      551      +41     
- Misses         91      108      +17     
Flag Coverage Δ
ui-browser 83.61% <100.00%> (-1.25%) ⬇️
ui-unit 83.61% <100.00%> (-1.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/ui/src/components/ai-actions.tsx 100.00% <ø> (ø)
packages/ui/src/components/app-nav.tsx 100.00% <ø> (ø)
packages/ui/src/components/badge-variants.ts 100.00% <100.00%> (ø)
packages/ui/src/components/badge.tsx 100.00% <ø> (ø)
packages/ui/src/components/breadcrumbs.tsx 92.85% <100.00%> (+0.54%) ⬆️
packages/ui/src/components/button-variants.ts 100.00% <100.00%> (ø)
packages/ui/src/components/button.tsx 100.00% <ø> (ø)
packages/ui/src/components/code-block.tsx 92.15% <100.00%> (+0.15%) ⬆️
packages/ui/src/components/elide-logo.tsx 100.00% <ø> (ø)
packages/ui/src/components/mobile-nav.tsx 91.17% <100.00%> (ø)
... and 12 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sgammon Sam Gammon (sgammon) merged commit 5eea68c into main Jul 15, 2026
9 checks passed
@sgammon Sam Gammon (sgammon) deleted the fix/react-doctor-cleanup branch July 15, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant